import query from '@dfeidao/atom-nodejs/db/query';
import { IncomingHttpHeaders } from 'http';
import { systemid } from '../../atom/config';

interface Message {
	project_asset_no: string;
}


export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {
	const q = query(action_id, session_id, systemid);
	// 根据项目资产编号获取项目资产数据
	q.prepare('project_assets', ['project_name', 'equip_depart_name', 'assetsname', 'asset_classification_name',
		'brand_no', 'customer_assets', 'unitprice', 'place', 'maintenance_time', 'remark', 'timeout_alert', 'timeout_reminder_time',
		'asset_grade', 'sec_image'], { project_asset_no: message.project_asset_no }, 200, 1, [], []);
	const [res] = await q.exec();
	return res;
}
